package com.note.common.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.note.common.constants.TCNameConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Date;

/**
 * @Package：com.note.common.domain
 * @Name：File
 * @Author：热伊木
 * @Email：uyevan@163.com
 * @Date：2024-05-02-9:15
 * @Description：文件实体模型
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(TCNameConstants.FILE)
@Entity(name = TCNameConstants.FILE)
@Schema(description = "笔记文件记录表")
public class File {
    @Id
    @Schema(description = "唯一ID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    @Column(name = "note_id")
    @Schema(description = "关联笔记Id")
    private String noteId;
    @Column(name = "username")
    @Schema(description = "用户名")
    private String username;
    @Column(name = "url")
    @Schema(description = "相对路径")
    private String url;
    @Column(name = "create_time")
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT) /*当前时间*/
    private Date createTime;

}
